<template>
  <div>
    <label><input v-model="current" type="radio" :value="comA">a</label>
    <label><input v-model="current" type="radio" :value="comB">b</label>
    <KeepAlive include="comA">
      <component :is="current"></component>
    </KeepAlive>
  </div>
</template>

<script setup>
  import comA from './comA.vue'
  import comB from './comB.vue'
  const current = shallowRef(comA)
</script>